package com.zpark.feign.controller;

import com.zpark.feign.i_feign.IRankingFeign;
import com.zpark.feign.pojo.Ranking;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/feign")
public class FeignController {

    @Autowired
    private IRankingFeign rankingFeign;

    @PostMapping("/all")
    public List<Ranking> all(){
        return rankingFeign.findAll1();
    }

    @GetMapping("/feign_find/{id}")
    public Ranking getById(@PathVariable Integer id){
        return rankingFeign.findById1(id);
    }
}
